<?php

$this->useClass('RL_Model2');

/**
 * Model_Uniform позволяет объектам представляться.
 *
 * @author lucky
 */
class Model_Uniform extends RL_Model2
{
	public function getUniform ($o, $type=NULL)
	{
		return $this->getFactory('Abstract')->getUniform($o, $type);
	} // end of method getUniform
	public function getFactory ($type)
	{
		$class = "Uniform_Factory_".ucfirst($type);
		if ($this->useClass($class)) {
			$factory = new $class($this, 'Uniform_');
		} else {
			$factory = false;
		}
		return $factory;
	} // end of method getFactory

	public function useClass ($class)
	{
		return $this->mm->rh->useClass($class);
	} // end of method useClass
	public function makeUrl ($rule, $params)
	{
		$rh = $this->mm->rh;

		$this->useClass('RL_URLGenerator');
		$ug = new RL_URLGenerator($rh->router->getRule($rule));
		$ug->setRouter($rh->router);
		$ug->setParams($params);
		$GET = $rh->GET;
		$ug->setGet($GET);
		return $ug->generateUrl();
	} // end of method getUrl
	public function getStore ()
	{
		return $this->store;
	} // end of method getStorage
}

